#!/usr/bin/perl

use strict;
use IO::Socket;

sub main {
    my $host = shift || die "Please input Host";
    my $port = shift || die "Please input Port";
    my $url = shift || die "Please input URL";
    
    my $sock = IO::Socket::INET->new(PeerAddr => "$host:$port");
    if (!$sock) {
        die $!;
    }
    if (!$sock->print($url . "\n")) {
        die $!;
    }
    if (!$sock->close()) {
        die $!;
    }
}

main(@ARGV);
